#include <func.h>


void* thread_func(void *p)
{
    //获取子线程ID
    printf("I am child thread,%lu\n",pthread_self());
    return (void*)1;
}
//子线程退出，我们接一个整型
int main()
{
    pthread_t th_id;
    int ret=pthread_create(&th_id,NULL,thread_func,NULL);//创建线程
    THREAD_ERR_CHECK(ret,"pthread_create");
    long thread_ret;//用来接子线程的返回值
    ret=pthread_join(th_id,(void**)&thread_ret);//类似于wait
    THREAD_ERR_CHECK(ret,"pthread_join");
    printf("I am main thread %ld\n",thread_ret);
    return 0;
}